//
//  DSMianViewController.m
//  DS爱信
//
//  Created by 秦建英 on 14-5-26.
//  Copyright (c) 2014年 秦建英. All rights reserved.
//

#import "DSMianViewController.h"
#import "Header.h"
@interface DSMianViewController ()
@end
@implementation DSMianViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"df.png"] forBarMetrics:UIBarMetricsDefault];
    [self.tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"tabbar_bg"]];
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    [self uiConfig];
}
#pragma mark===pingmu
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{ return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
    return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait;
}
-(void)uiConfig
{
    if(IOS7==YES)
    {
        //IOS7 之后的属性。设置为No,会消除试图控制器对scrollView contentOffset 的影响
        self.automaticallyAdjustsScrollViewInsets =NO;
        
        // 不透明的操作栏<br
        self.extendedLayoutIncludesOpaqueBars =NO;
        //视图控制器，四条边不指定
        self.edgesForExtendedLayout =UIRectEdgeNone;
        self.modalPresentationCapturesStatusBarAppearance = NO;
    }
}
//根据标题，设置titleView
-(void)addTitleviewWithTitle:(NSString *)title
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,200,30)];
    label.text = title;
    label.backgroundColor =[UIColor clearColor];
    NSLog(@"title--%@",title);
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:22];
    label.textColor = [UIColor colorWithRed:230/255.f green:260/255.f blue:130/255.f alpha:1];
    self.navigationItem.titleView = label;
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}
@end
